
import {interpolateRdGy} from "d3";
import {buildScale, newInterpolator, quantize} from "./palette.js";


export function createNO2Palette(resolution = 1000) {

    const bounds = [1e-11, 2e-7];  // units: ppb
    const logBounds = bounds.map(Math.log);
    const interpolator = newInterpolator(t => interpolateRdGy(1-t), "GyRd", logBounds);
    const colors = quantize(logBounds, [interpolator], resolution);

    return buildScale(bounds, colors, Math.log, Math.exp);

}
